This file explains how to use the replication materials for the paper, "Empirically Evaluating the Counter-Majoritarian Difficulty: Public Opinion, State Policy, and Judicial Review Before Roe v. Wade," to be published in the Journal of Law Courts.

HERE IS VERSION OF R I USED, ALONG WITH VERSIONS OF PACKAGES USED
# > sessionInfo()
# R version 3.1.0 (2014-04-10)
# Platform: x86_64-apple-darwin10.8.0 (64-bit)
# 
# locale:
# [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
# 
# attached base packages:
# [1] grid      stats     graphics  grDevices utils     datasets  methods   base     
# 
# other attached packages:
#  [1] apsrtable_0.8-8 mrp_1.0-1       mrpdata_1.0     reshape2_1.4    plyr_1.8.1      lattice_0.20-29
#  [7] sp_1.0-15       blme_1.0-2      foreign_0.8-61  arm_1.6-10      lme4_1.1-6      Rcpp_0.11.3    
# [13] Matrix_1.1-3    MASS_7.3-31    
# 
# loaded via a namespace (and not attached):
# [1] abind_1.4-0         coda_0.16-1         minqa_1.2.3         nlme_3.1-117       
# [5] RcppEigen_0.3.2.2.0 splines_3.1.0       stringr_0.6.2    

#TO INSTALL MRP PACKAGE FROM GITHUB, RUN THESE COMMANDS
#library(devtools) ; install_github("mrp", "malecki", sub="mrpdata")
#library(devtools) ; install_github("mrp", "malecki", sub="mrp")


1) I first describe the creation of the poststratification file, to be used
later in the MRP estimation. This is done using the script
"create_1970_poststrat.R". This script calls the following data files: A)
"census uncompressed 1970.dta"; this is the 5-Percent Public Use Microdata
Sample'' in the Census, from the 1970 Census. B)
"statelevel_to_use_in_mrp.dta"; this contains data at the state-level, to be
used in the MRP models.

The script creates both "1970_poststrat_race_wb_synthetic.dta," which I use in the estimates, and 1970_poststrat_race_wb.dta", which I do not (though it produces similar results). The synthetic file implements the technique of Leemann and Wasserfallen (2014), which is described in the appendix. 

2)   Next, the script "replicate_main_analyses.R" runs all the analyses presented in the paper. In addition to "statelevel_to_use_in_mrp.dta" (which contains data on policy and judicial decisions at the statelevel) and "1970_poststrat_race_wb_synthetic.dta" (discussed above), it calls A) "pre_roe_megapoll.dta", the megapoll of individual-level survey responses. B) "aggregate_index_results_1962_1972.dta", a summary of aggregate level opinion (taken from the aggregate results in iPoll).
	
Finally, the scripts "poststrat_w_uncertainty.R" and "fitted.R" create functions to esimtate uncertainty for the MRP estimates.


